package com.awt.topic1;


import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 * @ClassName: StarterApplication
 * @Author: ZhangYue26
 * @Description: 应用程序一
 * @Date: 2020-08-07
 */
public class StarterApplication extends Frame {
    public static void main(String[] args) {
        StarterApplication starterApplication = new StarterApplication("Starter Application");
        starterApplication.setSize(300, 100);
        starterApplication.show();
        System.out.println("Starter Application:: main()");
    }

    public StarterApplication(String frameTitle) {
        super(frameTitle);
        add(new Label("Starter", Label.CENTER), "Center");
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                dispose();//释放资源
                System.exit(0);
            }
        });

    }

}
